#include "summarypanel.h"

SummaryPanel::SummaryPanel( int itemNumber, QWidget* parent ) : QWidget( parent ), m_ItemsNumber( itemNumber )
{
    this->initView();
}

void SummaryPanel::initView()
{

    QStringList  titles;
    uint         index   = 0;
    QVBoxLayout* layout  = new QVBoxLayout;
    QGridLayout* itemLay = new QGridLayout;
    this->m_GroupBox     = new QGroupBox( this );

    this->m_GroupBox->setStyleSheet( QString( "QGroupBox{border:0px solid #79716b;border-radius:6px;background:#433e3a;}" ) );
    titles << "核心舱总压"
           << "核心舱湿度"
           << "核心舱O2分压"
           << "高度"
           << "核心舱CO2分压"
           << "器下点经度"
           << "核心舱温度"
           << "器下点纬度";

    for ( int row = 0; row < 4; row++ )
    {
        for ( int col = 0; col < 2; col++ )
        {
            itemLay->addWidget( new DataDispWidget( titles.at( index++ ), "", this ), row, col );
        }
    }

    this->m_GroupBox->setLayout( itemLay );
    layout->addWidget( m_GroupBox );
    layout->setContentsMargins( 0, 0, 0, 0 );
    this->setLayout( layout );
    this->setFixedSize( 600, 300 );
}
